<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>MediaCrawler 数据查看器 - 演示版</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Microsoft YaHei', Arial, sans-serif;
            background-color: #f5f5f5;
            color: #333;
        }

        .container {
            max-width: 1400px;
            margin: 0 auto;
            background: white;
            min-height: 100vh;
        }

        /* 头部 */
        .header {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 20px;
            text-align: center;
        }

        .header h1 {
            font-size: 28px;
            margin-bottom: 10px;
        }

        .header p {
            opacity: 0.9;
            font-size: 16px;
        }

        /* 平台切换栏 */
        .platform-bar {
            background: #fff;
            padding: 20px;
            border-bottom: 1px solid #e0e0e0;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        }

        .platform-buttons {
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
            margin-bottom: 15px;
        }

        .platform-btn {
            padding: 10px 20px;
            border: 2px solid #ddd;
            background: white;
            border-radius: 25px;
            cursor: pointer;
            transition: all 0.3s;
            font-size: 14px;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .platform-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(0,0,0,0.1);
        }

        .platform-btn.active {
            background: #667eea;
            color: white;
            border-color: #667eea;
        }

        .platform-count {
            background: rgba(255,255,255,0.2);
            padding: 2px 8px;
            border-radius: 12px;
            font-size: 12px;
        }

        .data-stats {
            color: #666;
            font-size: 14px;
        }

        /* 控制面板 */
        .control-panel {
            background: #f8f9fa;
            padding: 20px;
            border-bottom: 1px solid #e0e0e0;
        }

        .data-types {
            display: flex;
            gap: 15px;
            margin-bottom: 20px;
            flex-wrap: wrap;
        }

        .data-type-btn {
            padding: 12px 24px;
            background: white;
            border: 1px solid #ddd;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.3s;
            text-align: center;
            min-width: 120px;
        }

        .data-type-btn:hover {
            border-color: #667eea;
            color: #667eea;
        }

        .data-type-btn.active {
            background: #667eea;
            color: white;
            border-color: #667eea;
        }

        .data-type-count {
            display: block;
            font-size: 12px;
            opacity: 0.7;
            margin-top: 4px;
        }

        /* 筛选器 */
        .filter-section {
            background: white;
            padding: 20px;
            border-radius: 8px;
            margin-bottom: 20px;
            box-shadow: 0 2px 4px rgba(0,0,0,0.05);
        }

        .filter-row {
            display: flex;
            gap: 15px;
            margin-bottom: 15px;
            flex-wrap: wrap;
            align-items: center;
        }

        .filter-group {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .filter-input {
            padding: 8px 12px;
            border: 1px solid #ddd;
            border-radius: 4px;
            font-size: 14px;
        }

        .filter-select {
            padding: 8px 12px;
            border: 1px solid #ddd;
            border-radius: 4px;
            background: white;
            cursor: pointer;
        }

        .filter-btn {
            padding: 8px 16px;
            background: #667eea;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            transition: background 0.3s;
        }

        .filter-btn:hover {
            background: #5a6fd8;
        }

        .filter-btn.secondary {
            background: #6c757d;
        }

        /* 视图切换 */
        .view-controls {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
            padding: 0 20px;
        }

        .view-modes {
            display: flex;
            gap: 10px;
        }

        .view-mode-btn {
            padding: 8px 16px;
            border: 1px solid #ddd;
            background: white;
            border-radius: 4px;
            cursor: pointer;
            transition: all 0.3s;
        }

        .view-mode-btn.active {
            background: #667eea;
            color: white;
            border-color: #667eea;
        }

        .result-info {
            color: #666;
            font-size: 14px;
        }

        /* 数据展示区域 */
        .data-display {
            padding: 0 20px 20px;
        }

        /* 列表视图 */
        .list-view {
            background: white;
            border-radius: 8px;
            overflow: hidden;
            box-shadow: 0 2px 4px rgba(0,0,0,0.05);
        }

        .list-header {
            background: #f8f9fa;
            padding: 15px;
            border-bottom: 1px solid #e0e0e0;
            display: grid;
            grid-template-columns: 40px 60px 1fr 100px 80px 80px 120px;
            gap: 15px;
            font-weight: bold;
            color: #666;
        }

        .list-item {
            padding: 15px;
            border-bottom: 1px solid #f0f0f0;
            display: grid;
            grid-template-columns: 40px 60px 1fr 100px 80px 80px 120px;
            gap: 15px;
            align-items: center;
            transition: background 0.2s;
        }

        .list-item:hover {
            background: #f8f9fa;
        }

        .list-item:last-child {
            border-bottom: none;
        }

        .item-checkbox {
            width: 18px;
            height: 18px;
        }

        .item-id {
            font-family: monospace;
            color: #666;
        }

        .item-title {
            font-weight: 500;
            color: #333;
            cursor: pointer;
        }

        .item-title:hover {
            color: #667eea;
        }

        .item-author {
            color: #666;
        }

        .item-stats {
            text-align: center;
            color: #666;
        }

        .item-time {
            color: #999;
            font-size: 13px;
        }

        /* 卡片视图 */
        .card-view {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
            gap: 20px;
        }

        .data-card {
            background: white;
            border-radius: 12px;
            padding: 20px;
            box-shadow: 0 4px 6px rgba(0,0,0,0.07);
            transition: all 0.3s;
            border: 1px solid #e0e0e0;
        }

        .data-card:hover {
            transform: translateY(-4px);
            box-shadow: 0 8px 25px rgba(0,0,0,0.15);
        }

        .card-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            margin-bottom: 12px;
        }

        .card-title {
            font-size: 16px;
            font-weight: 600;
            color: #333;
            line-height: 1.4;
            margin-bottom: 8px;
        }

        .card-platform {
            background: #667eea;
            color: white;
            padding: 4px 8px;
            border-radius: 12px;
            font-size: 12px;
        }

        .card-meta {
            color: #666;
            font-size: 13px;
            margin-bottom: 12px;
        }

        .card-content {
            color: #555;
            line-height: 1.6;
            margin-bottom: 15px;
            display: -webkit-box;
            -webkit-line-clamp: 3;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

        .card-stats {
            display: flex;
            gap: 15px;
            margin-bottom: 15px;
            color: #666;
            font-size: 14px;
        }

        .card-actions {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
        }

        .card-btn {
            padding: 6px 12px;
            border: 1px solid #ddd;
            background: white;
            border-radius: 4px;
            cursor: pointer;
            font-size: 12px;
            transition: all 0.2s;
        }

        .card-btn:hover {
            background: #f0f0f0;
        }

        .card-btn.primary {
            background: #667eea;
            color: white;
            border-color: #667eea;
        }

        /* 分页 */
        .pagination {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 10px;
            margin-top: 30px;
            padding: 20px;
        }

        .page-btn {
            padding: 8px 12px;
            border: 1px solid #ddd;
            background: white;
            border-radius: 4px;
            cursor: pointer;
            transition: all 0.2s;
        }

        .page-btn:hover {
            background: #f0f0f0;
        }

        .page-btn.active {
            background: #667eea;
            color: white;
            border-color: #667eea;
        }

        .page-info {
            color: #666;
            margin: 0 15px;
        }

        /* 批量操作栏 */
        .batch-actions {
            background: #e3f2fd;
            padding: 15px 20px;
            border-radius: 8px;
            margin-bottom: 20px;
            display: none;
        }

        .batch-actions.show {
            display: block;
        }

        .batch-info {
            color: #1976d2;
            font-weight: 500;
            margin-bottom: 10px;
        }

        .batch-buttons {
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
        }

        .batch-btn {
            padding: 8px 16px;
            background: #1976d2;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-size: 14px;
            transition: background 0.3s;
        }

        .batch-btn:hover {
            background: #1565c0;
        }

        .batch-btn.danger {
            background: #d32f2f;
        }

        .batch-btn.danger:hover {
            background: #c62828;
        }

        /* 响应式设计 */
        @media (max-width: 768px) {
            .platform-buttons {
                justify-content: center;
            }
            
            .filter-row {
                flex-direction: column;
                align-items: stretch;
            }
            
            .list-header,
            .list-item {
                grid-template-columns: 40px 1fr 80px;
                gap: 10px;
            }
            
            .list-header .hide-mobile,
            .list-item .hide-mobile {
                display: none;
            }
            
            .card-view {
                grid-template-columns: 1fr;
            }
        }

        /* 加载动画 */
        .loading {
            text-align: center;
            padding: 40px;
            color: #666;
        }

        .spinner {
            border: 3px solid #f3f3f3;
            border-top: 3px solid #667eea;
            border-radius: 50%;
            width: 30px;
            height: 30px;
            animation: spin 1s linear infinite;
            margin: 0 auto 15px;
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }
    </style>
</head>
<body>
    <div class="container">
        <!-- 头部 -->
        <div class="header">
            <h1>🔍 MediaCrawler 数据查看器</h1>
            <p>多平台社交媒体数据管理与分析工具</p>
        </div>

        <!-- 平台切换栏 -->
        <div class="platform-bar">
            <div class="platform-buttons">
                <button class="platform-btn" onclick="switchPlatform('all')">
                    🌐 全部平台 <span class="platform-count">4,124</span>
                </button>
                <button class="platform-btn active" onclick="switchPlatform('zhihu')">
                    🗣️ 知乎 <span class="platform-count">1,234</span>
                </button>
                <button class="platform-btn" onclick="switchPlatform('xhs')">
                    🔴 小红书 <span class="platform-count">856</span>
                </button>
                <button class="platform-btn" onclick="switchPlatform('douyin')">
                    🎵 抖音 <span class="platform-count">678</span>
                </button>
                <button class="platform-btn" onclick="switchPlatform('bilibili')">
                    📺 B站 <span class="platform-count">432</span>
                </button>
                <button class="platform-btn" onclick="switchPlatform('weibo')">
                    📱 微博 <span class="platform-count">234</span>
                </button>
            </div>
            <div class="data-stats">
                📊 总计 4,124 条 | 今日新增 89 条 | 最后更新: 15:42
            </div>
        </div>

        <!-- 控制面板 -->
        <div class="control-panel">
            <!-- 数据类型选择 -->
            <div class="data-types">
                <button class="data-type-btn active" onclick="switchDataType('posts')">
                    📝 帖子内容
                    <span class="data-type-count">(1,234)</span>
                </button>
                <button class="data-type-btn" onclick="switchDataType('comments')">
                    💬 评论数据
                    <span class="data-type-count">(5,678)</span>
                </button>
                <button class="data-type-btn" onclick="switchDataType('users')">
                    👤 用户信息
                    <span class="data-type-count">(890)</span>
                </button>
                <button class="data-type-btn" onclick="switchDataType('media')">
                    🎬 媒体文件
                    <span class="data-type-count">(456)</span>
                </button>
            </div>

            <!-- 筛选器 -->
            <div class="filter-section">
                <div class="filter-row">
                    <div class="filter-group">
                        <label>🔍 关键词:</label>
                        <input type="text" class="filter-input" placeholder="搜索内容..." value="游戏,pan.quark.cn">
                    </div>
                    <div class="filter-group">
                        <label>👤 作者:</label>
                        <select class="filter-select">
                            <option>全部</option>
                            <option>张三</option>
                            <option>李四</option>
                        </select>
                    </div>
                    <div class="filter-group">
                        <label>📅 时间:</label>
                        <select class="filter-select">
                            <option>最近7天</option>
                            <option>最近30天</option>
                            <option>自定义</option>
                        </select>
                    </div>
                </div>
                <div class="filter-row">
                    <div class="filter-group">
                        <label>👍 点赞数:</label>
                        <input type="number" class="filter-input" placeholder="最小值" value="10" style="width: 80px;">
                        <span>~</span>
                        <input type="number" class="filter-input" placeholder="最大值" style="width: 80px;">
                    </div>
                    <div class="filter-group">
                        <label>💬 评论数:</label>
                        <input type="number" class="filter-input" placeholder="最小值" value="5" style="width: 80px;">
                    </div>
                    <button class="filter-btn" onclick="applyFilter()">应用筛选</button>
                    <button class="filter-btn secondary" onclick="resetFilter()">重置</button>
                </div>
            </div>
        </div>

        <!-- 视图控制 -->
        <div class="view-controls">
            <div class="view-modes">
                <button class="view-mode-btn active" onclick="switchView('list')">📋 列表视图</button>
                <button class="view-mode-btn" onclick="switchView('card')">🃏 卡片视图</button>
            </div>
            <div class="result-info">
                显示第 1-20 条，共 156 条记录
            </div>
        </div>

        <!-- 批量操作栏 -->
        <div class="batch-actions" id="batchActions">
            <div class="batch-info">已选择 <span id="selectedCount">0</span> 条记录</div>
            <div class="batch-buttons">
                <button class="batch-btn">📤 导出选中</button>
                <button class="batch-btn">📋 复制链接</button>
                <button class="batch-btn">🏷️ 批量标签</button>
                <button class="batch-btn">⭐ 批量收藏</button>
                <button class="batch-btn danger">🗑️ 批量删除</button>
            </div>
        </div>

        <!-- 数据展示区域 -->
        <div class="data-display">
            <!-- 列表视图 -->
            <div class="list-view" id="listView">
                <div class="list-header">
                    <input type="checkbox" id="selectAll" onchange="toggleSelectAll()">
                    <div>ID</div>
                    <div>标题</div>
                    <div>作者</div>
                    <div class="hide-mobile">点赞</div>
                    <div class="hide-mobile">评论</div>
                    <div>时间</div>
                </div>
                
                <div class="list-item">
                    <input type="checkbox" class="item-checkbox" onchange="updateSelection()">
                    <div class="item-id">001</div>
                    <div class="item-title">游戏资源分享大全 - 最新热门游戏合集</div>
                    <div class="item-author">张三</div>
                    <div class="item-stats hide-mobile">128</div>
                    <div class="item-stats hide-mobile">45</div>
                    <div class="item-time">08-03</div>
                </div>
                
                <div class="list-item">
                    <input type="checkbox" class="item-checkbox" onchange="updateSelection()">
                    <div class="item-id">002</div>
                    <div class="item-title">pan.quark.cn 使用教程详解</div>
                    <div class="item-author">李四</div>
                    <div class="item-stats hide-mobile">89</div>
                    <div class="item-stats hide-mobile">23</div>
                    <div class="item-time">08-02</div>
                </div>
                
                <div class="list-item">
                    <input type="checkbox" class="item-checkbox" onchange="updateSelection()">
                    <div class="item-id">003</div>
                    <div class="item-title">最新游戏下载合集 - 持续更新中</div>
                    <div class="item-author">王五</div>
                    <div class="item-stats hide-mobile">156</div>
                    <div class="item-stats hide-mobile">67</div>
                    <div class="item-time">08-01</div>
                </div>
                
                <div class="list-item">
                    <input type="checkbox" class="item-checkbox" onchange="updateSelection()">
                    <div class="item-id">004</div>
                    <div class="item-title">游戏攻略分享 - 新手必看指南</div>
                    <div class="item-author">赵六</div>
                    <div class="item-stats hide-mobile">67</div>
                    <div class="item-stats hide-mobile">12</div>
                    <div class="item-time">07-31</div>
                </div>
                
                <div class="list-item">
                    <input type="checkbox" class="item-checkbox" onchange="updateSelection()">
                    <div class="item-id">005</div>
                    <div class="item-title">夸克网盘使用技巧大全</div>
                    <div class="item-author">钱七</div>
                    <div class="item-stats hide-mobile">234</div>
                    <div class="item-stats hide-mobile">89</div>
                    <div class="item-time">07-30</div>
                </div>
            </div>

            <!-- 卡片视图 -->
            <div class="card-view" id="cardView" style="display: none;">
                <div class="data-card">
                    <div class="card-header">
                        <input type="checkbox" class="item-checkbox">
                        <span class="card-platform">🗣️ 知乎</span>
                    </div>
                    <div class="card-title">游戏资源分享大全 - 最新热门游戏合集</div>
                    <div class="card-meta">👤 张三 | ⏰ 2025-08-03 15:30 | 🏷️ 游戏,资源</div>
                    <div class="card-content">
                        分享一些最新的游戏资源，包含各种热门游戏的下载链接和安装教程。这些资源都是我精心收集的，保证安全无毒，欢迎大家收藏分享...
                    </div>
                    <div class="card-stats">
                        <span>👍 128</span>
                        <span>💬 45</span>
                        <span>🔄 23</span>
                        <span>👁️ 1.2K</span>
                    </div>
                    <div class="card-actions">
                        <button class="card-btn primary">📋 详情</button>
                        <button class="card-btn">💬 评论</button>
                        <button class="card-btn">🔗 链接</button>
                        <button class="card-btn">⭐ 收藏</button>
                    </div>
                </div>

                <div class="data-card">
                    <div class="card-header">
                        <input type="checkbox" class="item-checkbox">
                        <span class="card-platform">🗣️ 知乎</span>
                    </div>
                    <div class="card-title">pan.quark.cn 使用教程详解</div>
                    <div class="card-meta">👤 李四 | ⏰ 2025-08-02 14:20 | 🏷️ 教程,网盘</div>
                    <div class="card-content">
                        详细介绍夸克网盘的使用方法，包括注册、上传、分享等功能的使用技巧，新手必看的完整教程...
                    </div>
                    <div class="card-stats">
                        <span>👍 89</span>
                        <span>💬 23</span>
                        <span>🔄 12</span>
                        <span>👁️ 856</span>
                    </div>
                    <div class="card-actions">
                        <button class="card-btn primary">📋 详情</button>
                        <button class="card-btn">💬 评论</button>
                        <button class="card-btn">🔗 链接</button>
                        <button class="card-btn">⭐ 收藏</button>
                    </div>
                </div>

                <div class="data-card">
                    <div class="card-header">
                        <input type="checkbox" class="item-checkbox">
                        <span class="card-platform">🗣️ 知乎</span>
                    </div>
                    <div class="card-title">最新游戏下载合集 - 持续更新中</div>
                    <div class="card-meta">👤 王五 | ⏰ 2025-08-01 16:45 | 🏷️ 游戏,下载</div>
                    <div class="card-content">
                        收集了最新最热门的游戏下载链接，包括单机游戏、网络游戏等，所有资源都经过测试，持续更新中...
                    </div>
                    <div class="card-stats">
                        <span>👍 156</span>
                        <span>💬 67</span>
                        <span>🔄 34</span>
                        <span>👁️ 2.1K</span>
                    </div>
                    <div class="card-actions">
                        <button class="card-btn primary">📋 详情</button>
                        <button class="card-btn">💬 评论</button>
                        <button class="card-btn">🔗 链接</button>
                        <button class="card-btn">⭐ 收藏</button>
                    </div>
                </div>
            </div>

            <!-- 分页 -->
            <div class="pagination">
                <button class="page-btn">◀️ 上一页</button>
                <button class="page-btn active">1</button>
                <button class="page-btn">2</button>
                <button class="page-btn">3</button>
                <button class="page-btn">...</button>
                <button class="page-btn">8</button>
                <button class="page-btn">下一页 ▶️</button>
                <div class="page-info">第 1/8 页，每页 20 条</div>
            </div>
        </div>
    </div>

    <script>
        // 平台切换
        function switchPlatform(platform) {
            document.querySelectorAll('.platform-btn').forEach(btn => {
                btn.classList.remove('active');
            });
            event.target.classList.add('active');
            
            // 模拟数据加载
            showLoading();
            setTimeout(() => {
                hideLoading();
                console.log('切换到平台:', platform);
            }, 500);
        }

        // 数据类型切换
        function switchDataType(type) {
            document.querySelectorAll('.data-type-btn').forEach(btn => {
                btn.classList.remove('active');
            });
            event.target.classList.add('active');
            
            showLoading();
            setTimeout(() => {
                hideLoading();
                console.log('切换数据类型:', type);
            }, 300);
        }

        // 视图切换
        function switchView(view) {
            document.querySelectorAll('.view-mode-btn').forEach(btn => {
                btn.classList.remove('active');
            });
            event.target.classList.add('active');
            
            const listView = document.getElementById('listView');
            const cardView = document.getElementById('cardView');
            
            if (view === 'list') {
                listView.style.display = 'block';
                cardView.style.display = 'none';
            } else {
                listView.style.display = 'none';
                cardView.style.display = 'grid';
            }
        }

        // 全选/取消全选
        function toggleSelectAll() {
            const selectAll = document.getElementById('selectAll');
            const checkboxes = document.querySelectorAll('.item-checkbox');
            
            checkboxes.forEach(checkbox => {
                checkbox.checked = selectAll.checked;
            });
            
            updateSelection();
        }

        // 更新选择状态
        function updateSelection() {
            const checkboxes = document.querySelectorAll('.item-checkbox');
            const selectedCount = Array.from(checkboxes).filter(cb => cb.checked).length;
            
            document.getElementById('selectedCount').textContent = selectedCount;
            
            const batchActions = document.getElementById('batchActions');
            if (selectedCount > 0) {
                batchActions.classList.add('show');
            } else {
                batchActions.classList.remove('show');
            }
        }

        // 应用筛选
        function applyFilter() {
            showLoading();
            setTimeout(() => {
                hideLoading();
                console.log('应用筛选条件');
            }, 800);
        }

        // 重置筛选
        function resetFilter() {
            document.querySelectorAll('.filter-input').forEach(input => {
                input.value = '';
            });
            document.querySelectorAll('.filter-select').forEach(select => {
                select.selectedIndex = 0;
            });
            applyFilter();
        }

        // 显示加载动画
        function showLoading() {
            const dataDisplay = document.querySelector('.data-display');
            dataDisplay.innerHTML = `
                <div class="loading">
                    <div class="spinner"></div>
                    <div>正在加载数据...</div>
                </div>
            `;
        }

        // 隐藏加载动画
        function hideLoading() {
            location.reload(); // 简单的重新加载，实际应用中应该动态更新数据
        }

        // 初始化
        document.addEventListener('DOMContentLoaded', function() {
            console.log('MediaCrawler 数据查看器已加载');
        });
    </script>
</body>
</html>